package com.chu.controller;

import com.chu.entity.Dept;
import com.chu.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class DeptController {

    @Autowired
    private DeptService service;

    //增加用户
    @RequestMapping("/resource/demo2/getAllDept")
    public String getAll(ModelMap map){

        List<Dept> deptList = service.findAllDept();
        map.addAttribute("deptList",deptList);
        return "resource/demo2/add";
    }





}
